package com.jie.deletefile.SlidingMenu;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.widget.FrameLayout;

import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu;
import com.jie.deletefile.R;

public class SlidingActivity extends FragmentActivity {
    private FrameLayout rl_con;
    private FirstFragment firstFragment;
    private SecondFragment secondFragment;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sliding2);
        initview();
        initSilding();
    }

    private void initSilding() {
        secondFragment = new SecondFragment();
       SlidingMenu slidingMenu = new SlidingMenu(this);
        slidingMenu.setMode(SlidingMenu.LEFT);
        slidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
        slidingMenu.setBehindOffsetRes(R.dimen.slidingmenu_offset);
        slidingMenu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT);
        slidingMenu.setMenu(R.layout.sliding);

        getSupportFragmentManager().beginTransaction().replace(R.id.sli,secondFragment).commit();
    }

    private void initview() {
        rl_con = (FrameLayout) findViewById(R.id.rl_con);
        firstFragment = new FirstFragment();

        getSupportFragmentManager().beginTransaction().replace(R.id.rl_con,firstFragment ).commit();
    }
}
